﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Solution.Business.Entities;
using Solution.Business.Component;
using Solution.Data;

namespace Solution.UI.Web.Controllers
{
    public class SearchController : Controller
    {
        //
        // GET: /Search/

        public ActionResult SearchByTransaction()
        {
            var list = Business.Component.TransactionComponent.Transaction_GetByTop("4","len([Level])=4","");
            return PartialView(list);
        }

        public ActionResult SearchByProject1()
        {
            var list1 = Business.Component.TransactionComponent.Transaction_GetByTop("8", "len([Level])>4 and TrGroup = 1", "");
            return PartialView(list1);
        }

        public ActionResult SearchByProject2()
        {
            var list2 = Business.Component.TransactionComponent.Transaction_GetByTop("8", "len([Level])>4 and TrGroup = 2", "");
            return PartialView(list2);
        }

        public ActionResult SearchByLocation()
        {
            var list3 = Business.Component.LocationComponent.Location_GetByTop("25","len([Level])>4 and left([Level],4)=0001","");
            return PartialView(list3);
        }

        public ActionResult SearchByPrice()
        {
            var list4 = Business.Component.PaymentComponent.Payments_GetByTop("1", "PmPosition = 1", "");
            return PartialView(list4);

        }

        public ActionResult SearchByPrice1()
        {
            var list6 = Business.Component.PaymentComponent.Payments_GetByTop("1", "PmPosition = 2", "");
            return PartialView(list6);
        }

        public ActionResult SearchByAcreage()
        {
            var list5 = Business.Component.UnitComponent.Unit_GetByTop("1","UnPosition = 1","");
            return PartialView(list5);

        }

    }
}
